package exam.wangyi8_21;

import java.util.Scanner;

public class test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        String[] s1 = s.split(" ");
        int m = in.nextInt();
        int l = s1.length;

        int num[] = new int[l];
        for (int i = 0; i < s1.length; i++) {
            num[i] = Integer.parseInt(s1[i]);
        }


        int res = 0;

        for (int i = 0; i < l-1; i++) {
            for (int j = i+1; j < l; j++) {
                if(num[i]+num[j]<m){
                    res++;
                }
            }
        }
        System.out.println(res);
    }
}
